package com.woniuxy.service.imp;

import com.woniuxy.dao.CityMapper;
import com.woniuxy.model.City;
import com.woniuxy.service.CityService;
import com.woniuxy.util.SqlSessionUtil;

import java.util.List;

public class CityServiceImpl implements CityService {
    @Override
    public List<City> getCities() {
        CityMapper mapper = SqlSessionUtil.getMapper(CityMapper.class);
        List<City> cities = mapper.getCities();
        return cities;
    }

    @Override
    public void deleteCities(List<Integer> ids) {
        CityMapper mapper = SqlSessionUtil.getMapper(CityMapper.class);
        for (Integer id : ids) {
            mapper.deleteCity(id);
        }
    }
}
